<template>
  <div id="app">
    <MHeader :sellerInfo="sellerInfo"></MHeader>
    <tab></tab>
    <keep-alive>
      <router-view :sellerInfo="sellerInfo"></router-view>
    </keep-alive>
  </div>
</template>
<script>
import MHeader from './components/m-header/m-header'
import Tab from './components/tab/tab'
import {ERR_OK} from '@/api/config.js'

export default ({
  data() {
    return {
      sellerInfo: {
        // id: (() => {
        //   let queryParam = urlParse()
        //   return queryParam.id
        // })
      }
    }
  },
  methods: {
    _getSeller() {
      this.$axios
        .get("/api/seller")
        .then(res => {
          res = res.data
          if(res.errno === ERR_OK) {
            this.sellerInfo = res.data
          }
        })
        .catch(err => {
          throw new Error(err)
        })
    }
  },
  created() {
    this._getSeller()
  },
  components: {
    MHeader,
    Tab
  }
})
</script>
